{{include_file name='public/header'}}
<style>
    .table tr>td, .table tr>th {
        text-align: left;
    }
    .group-item {
        display: block;
        padding-right: 15px;
        float: left;
        font-size: 14px;
    }
    .text-right {
        border-right: #cfcfcf 1px solid;
        padding-right: 10px;
    }
</style>
<script type="text/javascript">
    function selectAll(checker, scope, type)
    {
        if (scope)
        {
            if (type == 'button')
            {
                $('#' + scope + ' input').each(function ()
                {
                    $(this).prop("checked", true)
                });
            } else if (type == 'checkbox')
            {
                $('#' + scope + ' input').each(function ()
                {
                    $(this).prop("checked", checker.checked)
                });
            }
        } else
        {
            if (type == 'button')
            {
                $('input:checkbox').each(function ()
                {
                    $(this).prop("checked", true)
                });
            } else if (type == 'checkbox')
            {
                $('input:checkbox').each(function ()
                {
                    $(this).prop("checked", checker.checked)
                });
            }
        }
    }
</script>
</head>
<body>
    <div id="wrapper">
        <!-- Navigation -->
        {{include_file name='public/nav' sidebar='sidebar'}}
        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <div class="page-header">
                        <h3>设置【{{$role.title}}】权限</h3>
                    </div>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <form method="post" action="/admin/role/perm" class="form-inline" role="form">
                                    <input type='hidden' name='roleid' value="{{$role['roleid']}}" />
                                    <table id='AuthroleList' class="table table-condensed table-hover table-striped tablesorter table-fixed table-selectable">
                                        <thead>
                                            <tr>
                                                <th style="width: 150px;">模块</th>
                                                <th>方法</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {{$premhtml}}
                                        </tbody>
                                        <tr>
                                            <td colspan="15">
                                                <div style="text-align: left;">
                                                    <input type='checkbox' name='allchecker[]' onclick='selectAll(this, "", "checkbox")' /> {{L('chkall')}}
                                                    <input type="submit" class="btn" name="sendsubmit" value="提交" />
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </form>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <div class="col-sm-12">

                </div>
                <!-- /.col-lg-6 -->
            </div>
            <!-- /#page-wrapper -->
        </div>
        <!-- /#wrapper -->
        <hr>
        <p class="text-center">{{get_config('copyright')}}</p>
        {{include_file name='public/footer'}}
